<% layout('/layouts/default.html', {title: '用户表管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('用户表管理')}
			</div>
			<div class="box-tools pull-right">
<!--				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>-->
				<% if(hasPermi('ic:icUser:edit')){ %>
<!--					<a href="${ctx}/ic/icUser/form" class="btn btn-default btnTool" title="${text('新增用户表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>-->
				<% } %>
<!--				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>-->
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${icUser}" action="${ctx}/ic/icUser/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<#form:hidden path="parentUserId" />
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>

<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("昵称")}', name:'nicheng', index:'a.mobile', width:150, align:"left", formatter: function(val, obj, row, act){
			return val?val:"兼职宝宝";
		}},
		{header:'${text("头像")}', name:'avatarUrl', index:'a.mobile', width:150, align:"center", formatter: function(val, obj, row, act){
			return '<img src="'+val+'" style="width: 50px;height: 50px;"/>';
		}},
		{header:'${text("手机号")}', name:'mobile', index:'a.mobile', width:150, align:"left"},

	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>

<script>
	function deviceList(id){
		js.layer.open({
			type: 2,
			title: '绑定的设备',
			shadeClose: true,
			shade: false,
			maxmin: true, //开启最大化最小化按钮
			area: ['80%', '700px'],
			content: "${ctx}/rt/rtDevice/daililist?dailishangId="+id
		});
	}

	function userList(id){
		js.layer.open({
			type: 2,
			title: '绑定的设备',
			shadeClose: true,
			shade: false,
			maxmin: true, //开启最大化最小化按钮
			area: ['80%', '700px'],
			content: "${ctx}/ic/icUser/list?parentUserId="+id
		});
	}
</script>